﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace ImageTagEditor.ValueConverters
{
	/// <summary>
	/// Used for converting zero based index values to one based index values
	/// </summary>
	public class ZeroToOneIndexBaseValueConverter : IValueConverter
	{

		/// <summary>
		/// Converter an integer of a zero based index to an integer for a 
		/// one based index
		/// </summary>
		/// <param name="value">The zero based index value</param>
		/// <param name="targetType">Not Used</param>
		/// <param name="parameter">Not Used</param>
		/// <param name="culture">Not Used</param>
		/// <returns>The one based index value</returns>
		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			if (value is int)
			{
				int intValue = (int)value + 1;
				return intValue;
			}
			throw new Exception("Can only convert values of type int");
		}

		/// <summary>
		/// Not Implemented
		/// </summary>
		/// <param name="value">Not Implemented</param>
		/// <param name="targetType">Not Implemented</param>
		/// <param name="parameter">Not Implemented</param>
		/// <param name="culture">Not Implemented</param>
		/// <returns>Not Implemented</returns>
		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}
